package org.apache.servicecomb.samples.practise.houserush.user.center.api;

import org.apache.servicecomb.samples.practise.houserush.user.center.aggregate.Building;
import org.apache.servicecomb.samples.practise.houserush.user.center.aggregate.House;
import org.apache.servicecomb.samples.practise.houserush.user.center.aggregate.Realestate;

import java.util.Date;
import java.util.List;

/**
 * @Author: Snake Man
 * @system:
 * @DateTime: 2021/12/26 21:30
 * @Description:
 */
public interface RealestateApi {

    Date testProvider();

    //新增楼盘
    Realestate createRealestate(Realestate realestate);

    //查询楼盘
    Realestate findRealestate(int id);

    //查询所有楼盘
    List<Realestate> indexRealestates();
    //修改楼盘
    Realestate updateRealestate(int id, Realestate realestate);
    //删除楼盘
    void removeRealestate(int id);


    //新增楼栋信息
    Building createBuilding(int realestateId, Building building);

    //查询楼栋信息
    Building findBuilding(int id);

    //修改楼栋信息
    Building updateBuilding(int id, Building building);

    //删除楼栋信息
    void removeBuilding(int id);

    //查询某一楼盘下所有楼栋
    List<Building> indexBuildings(int realestateId);

    // 新增房源信息
    House createHouse(int buidingId, House house);
    //查询房源信息
    House findHouse(int id);
    //修改房源信息
    House updateHouse(int id, House house);
    //删除房源信息
    void removeHouse(int id);
    //查询某一楼栋下所有房源
    List<House> indexHouses(int buildingId);
    //根据楼盘查询房源，显示未锁定房源
    Realestate findByRealestateId(Integer realestateId);
    //锁定房源
    List<House> lockHousesForSale(List<Integer> ids);
    //解锁房源
    int updateReleaseLockingStattesForHouses(List<Integer> ids);
}
